#ifndef ARRAY2D_H
#define ARRAY2D_H

#include <iostream>

using namespace std;

class Array2D {
   private:
    int row_num, col_num;
    float** data;

   public:
    Array2D(int rn, int cn) : row_num(rn), col_num(cn) {
        data = new float*[row_num];
        for (int i = 0; i < row_num; ++i) {
            data[i] = new float[col_num];
        }
    }
    ~Array2D() {
        for (int i = 0; i < row_num; ++i) {
            delete[] data[i];
        }
        delete[] data;
    }
    float* row(int i) {
        return data[i];
    }
};

#endif